package com.itheima.chapter12.reflect;

import com.itheima.chapter12.reflect.Domain.Student;

/*
    反射---获取类的字节码对象
 */
public class Demo1 {
    public static void main(String[] args) throws ClassNotFoundException {
       //通过class的静态方法 forName
        Class<?> aClass = Class.forName("com.itheima.chapter12.reflect.Domain.Student");
        System.out.println(aClass);
        //类名.class
        Class<Student> studentClass = Student.class;
        System.out.println(studentClass);
        // Object类中getClass()
        Student stu =new Student();
        Class<? extends Student> stuClass = stu.getClass();
        System.out.println(stuClass);
        System.out.println("-------------------");
        System.out.println(aClass==stuClass);
        System.out.println(aClass==studentClass);
        System.out.println(studentClass==stuClass);

    }
}
